<?php
/**
 * Created by PhpStorm.
 * User: zhj
 * Date: 2019/3/7
 * Time: 17:27
 */

namespace app\common\validate;

/**
 * 留言验证器
 */
class Msg extends ValidateBase
{

    // 验证规则
    protected $rule =   [
        'title'          => 'require',
        'content'       => 'require',
        //'category_id'   => 'require',
    ];

    // 验证提示
    protected $message  =   [
        'title.require'         => '留言标题不能为空',
        'content.require'      => '留言内容不能为空',
        //'category_id.require'  => '留言分类必须选择',
    ];

    // 应用场景
    protected $scene = [
        'edit'  =>  ['title', 'content']
    ];
}